<template>
	<view>
		<view>
		    <view class="topbg">
		        <!-- <image src="https://ayh.wissun.net/static/ayh/icon121.png" /> -->
		    </view>
		    <view class="tpbgd">
		        <image src="https://ayh.wissun.net/static/ayh/750.png?1"></image>
		    </view>
		    <view class="showrest">
		        <view class="norr"  v-if="status == 1">
		            <image src="https://pf.wissun.net/public/static/saoma/icon13.png"></image>
		            <view class="txtshow">{{msessage}}</view>
		        </view>
		        <view class="uurr" v-if="status == 2">
		            <view class="txtshowscss">
		                <view class="gxnhd">恭喜你，成功获取</view>
		                <view class="flex integre">
		                    <view class="jindvnn2" v-if="integral > 0">+{{integral}}
								<view class="jindv" >积分</view>
		                    </view>
							<view class="jindvnn2" v-if="prize_id != 44">¥{{prize_integral}}
								<view class="jindv" >红包</view>
							</view>
							<view class="jindvnn2" v-if="prize_id == 44">
								<view class="jindv" >加119元再来一罐</view>
							</view>
		                </view>
		            </view>
		            <image class="succssimg" src="https://pf.wissun.net/public/static/saoma/icon12.png"></image>
		        </view>
				<view class="agintoon" style="position: relative;top: 20px;" @click="go_again"  v-if="prize_id == 44">
				  立即兑换
				</view>
		        <view class="uurr" v-if="status == 3" style="height: 160px;">
		            <view class="txtshowscss">
		                <view class="gxnhd cca" >恭喜您</view>
		                <view class="gxnhd cca" >您的罐底码已可成功参与活动</view>
		            </view>   
		        </view>
		    </view>
			
		    <view class="agintoon" @click="gotoagain">
		      活动扫码
		    </view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				status:0,
				prize_id:"",
				prize_integral:"",
				integral:0,
				sncode:"",
				record_id:"",
				product_code:""
			}
		},
		onLoad(p) {
			if(p.integral){
				this.status=2;
				this.integral=p.integral
				this.prize_id=p.prize_id
				this.record_id=p.record_id
				this.prize_integral=p.prize_integral
				this.sncode=p.sncode
				this.product_code=p.product_code
			}
		},
		methods: {
			gotoagain(){
				uni.switchTab({
					url:"/pages/index/saoysao"
				})
			},
			//再来一罐
			go_again(){
				uni.redirectTo({
					url:"/pages/index/againbyone?sncode="+this.sncode+"&id="+this.record_id+"&product_code="+this.product_code
				})
			}
		}
	}
</script>

<style>
.topbg{
    height: 112px;
    width: 100%;
}
.topbg image{
    width: 100%;
    height: 100%;
}
.agintoon{
   text-align: center;
   color: #fff;
   background-color: #1B764A;
   width: 150px;
   height: 42px;
   line-height: 42px;
   border-radius: 5px;
   margin: 0 auto;
   font-size: 18px;
   font-weight: bold;
   position: relative;
   top: -62px;
}
.showpvodd{
  position: absolute;
  top: 0px;
  background-color: rgba(0, 0, 0, .5);
  width: 100%;
  height: 100%;
  z-index: 11;
}
.btoummd{
  text-align: center;
  width: 100%;
  margin: 0 auto;
}
.wdyuw{
  width: 200px;
  text-align: center;
  margin: 0 auto;
}
.contenad{
  position: relative;
  top:18%;
  text-align: center;
}
.showtips{
  text-align: center;
  font-size: 12px;
  color: #fff;
  position: relative;
  top: -15px;
  line-height: 20px;
}
page{
    background: url("https://ayh.wissun.net/static/ayh/waszil.png");
    background-size: cover;
    background-position: 180px 0px 0px 0px;
}
.tpbgd{position: relative;top: -116px;z-index: 10;}
.tpbgd image{height: 215px;width: 100%;}
.showrest{
    background: url('https://pf.wissun.net/public/static/saoma/icon11.png');
    background-size: 100% 100%;
    width: 90%;
    position: relative;
    top: -142px;
    margin: 0 auto;
}
.norr{
    width: 100%;
    text-align: center;
    padding-top: 68px;
    padding-bottom: 30px;
}
.norr image{
    width: 150px;
    height: 184px;
}
.txtshow{
    height: 17px;
    font-size: 14px;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #666666;
    line-height: 30px;
    text-align: center;
}
.jindv{
    color: #E46340;
    font-size: 30px;
    padding: 0px 10px 10px 5px;
}
.jindvnn{
    color: #E46340;
    font-size: 18px;
    font-weight: bold;
}
.jindvnn2{
    color: #E46340;
    font-size: 30px;
    font-weight: bold;
    width: 100%;
    margin: 0 auto;
    display: flex;
    text-align: center;
    justify-content: center;
}
.gxnhd{
    font-size: 14px;
    color: #666666;
    position: relative;
    top: -30px;
}
.flex{
    display: flex;
}
.txtshowscss{
    width: 100%;
    text-align: center;
}
.succssimg{
    width: 147px;
    height: 100px;
}
.uurr{
    text-align: center;
    padding-top: 118px;
    padding-bottom: 30px;
}
.cca{
    font-size: 16px;
    line-height: 30px;
    color: #666666;
    font-weight: bold;
}
.integre{
    text-align: center;
    width: 100%;
    margin:10px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}
</style>
